from wtforms import IntegerField, StringField
from wtforms.validators import DataRequired, Length

from .base import BaseFrom


class CaseGroupForm(BaseFrom):
    id = IntegerField(validators=[DataRequired(message="id不允许为空")])


class CaseGroupPageForm(CaseGroupForm):
    page = IntegerField(validators=[DataRequired(message="page不允许为空")])
    page_size = IntegerField(validators=[DataRequired(message="page_size不允许为空")])


class AddCaseGroupForm(CaseGroupForm):
    name = StringField(validators=[DataRequired(message="name不允许为空"), Length(min=1, max=18)])


class PutCaseGroupForm(AddCaseGroupForm):
    trigger = StringField(validators=[DataRequired(message="name不允许为空")])
    execute_time = IntegerField()
